package galaxies.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class ResearchRate {
	
	private HashMap<String, Double> researchRate = new HashMap<String, Double>();
	private ArrayList<String> entries = new ArrayList<String>();
	
	public ArrayList<String> getEntries() {
		return this.entries;
	}
	
	public void addResearchRate(String ref, Double researchRate) {
		this.researchRate.put(ref, researchRate);
		this.entries.add(ref);
	}
	
	public double getRate(String ref) {
		return researchRate.get(ref);
	}
	
	public HashMap<String, Double> getResearchRate() {
		return this.researchRate;
	}
	
	public void setResearchRate(HashMap<String, Double> researchRate) {
		this.researchRate.clear();
		this.researchRate.putAll(researchRate);
		
		for (Map.Entry<String, Double> entry : researchRate.entrySet()) {
			entries.add(entry.getKey());
		}
	}

}
